package com.anivia.system.auth.model.dto;

import com.anivia.system.auth.enums.ResourceTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author wangj
 */
@Data
@Schema
public class ResourceAddOrUpdateDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "id，更新时必传，新增时不传")
    private Integer id;

    @Schema(description = "名称")
    @NotBlank(message = "名称不能为空")
    private String name;

    @Schema(description = "资源类型")
    @NotNull(message = "资源类型不能为空")
    private ResourceTypeEnum type;

    @Schema(description = "父级id,默认为最顶级")
    private Integer pid;

    @Schema(description = "排序序号")
    private Integer sortNo;

    @Schema(description = "icon")
    private String icon;

    @Schema(description = "跳转路由")
    private String route;

    @Schema(description = "权限码")
    @NotBlank(message = "权限码不能为空")
    private String authCode;
}
